function AssertError(message) {
    this.name = "AssertError";
    this.message = message || "Assertion failed";
}
AssertError.prototype = new Error();
AssertError.prototype.constructor = AssertError;

/*
 * assertEq(actual, expected [, message])
 *   Throw if the two arguments are not the same.  The sameness of two values
 *   is determined as follows.  If both values are zero, they are the same iff
 *   their signs are the same.  Otherwise, if both values are NaN, they are the
 *   same.  Otherwise, they are the same if they compare equal using ===.
 * see https://bugzilla.mozilla.org/show_bug.cgi?id=480199 and
 *     https://bugzilla.mozilla.org/show_bug.cgi?id=515285
 */
var assertEquals =
    function (actual, expected, message)
    {
      function SameValue(v1, v2)
      {
        if (v1 === 0 && v2 === 0)
          return 1 / v1 === 1 / v2;
        if (v1 !== v1 && v2 !== v2)
          return true;
        return v1 === v2;
      }
      if (!SameValue(actual, expected))
      {
        throw new AssertError('Assertion failed: got "' + actual + '", expected "' + expected + '"' +
                            (message ? ": " + message : ""));
      }
    };

function assertTrue(actual) {
    assertEquals(actual, true);
}

function assertFalse(actual) {
    assertEquals(actual, false);
}
function mainchapter(message)
{
	var newli = document.createElement("li"),newli2 = document.createElement("li");
	newli.appendChild(document.createTextNode("--------------------------------------------------------------------"));
	newli.style.color = "#333";
	newli2.appendChild(document.createTextNode(message));
	newli2.style.color = "#666";
	newli2.style.fontWeight = "bold";
	document.getElementById("successlist").appendChild(newli);
	document.getElementById("successlist").appendChild(newli2);
}
function chapter(message)
{
	var newli = document.createElement("li");
	newli.appendChild(document.createTextNode(message));
	newli.style.color = "#33A";
	document.getElementById("successlist").appendChild(newli);
}
function success(message)
{
	var newli = document.createElement("li");
	newli.appendChild(document.createTextNode(message));
	newli.style.color = "#4A3";
	document.getElementById("successlist").appendChild(newli);
}
function $ERROR(message){
	var newli = document.createElement("li");
	newli.appendChild(document.createTextNode(message));
	newli.style.color = "#A33";
	document.getElementById("successlist").appendChild(newli);
}